//
//  UDPSocket.hpp
//  MultiPlayer
//
//  Created by 星落之尘 on 2020/6/9.
//  Copyright © 2020 Tan. All rights reserved.
//



#include "RoboCatShare.h"

class UDPSocket {
    ~UDPSocket();
    
    int Bind(const SocketAddress& inToAddress);
    int SendTo(const void* inToSend, int inLength, const SocketAddress& inToAddress);
    int ReceiveFrom(void* inToReceive, int inMaxLength, SocketAddress& outFromAddress );
    
    int SetNonBlockingMode(bool inShouldBetNonBlocking);
    
private:
        friend class SocketUtil;
    UDPSocket(SOCKET inSocket): mSocket(inSocket) {};
    SOCKET mSocket;
};

typedef shared_ptr< UDPSocket >    UDPSocketPtr;


